1. Field of the Invention
The present invention relates to a picture processing apparatus that allows a picture to be enlarged/reduced at any ratio and that is used for a special effect unit in a broadcasting station or the like, a television receiver, or a video tape recorder and to a picture processing method.
2. Description of the Related Art
In home-use television receivers, a so-called picture-in-picture system and the picture-and-picture system of which a reduced or enlarged screen is displayed along with an original screen has been practically used. The picture-in-picture consists of a smaller sub picture than the main picture framed and displayed on an original screen (main picture). On the other hand, the picture-and-picture consists of a plurality of a small pictures arranged and displayed. In the picture-in-picture system and the picture-and-picture system, another screen is reduced or enlarged at any fixed ratio that is a multiple of the size of the original screen. Thus, by simply filtering and thinning out pixels of an original screen to be reduced (enlarged), a reduced or enlarged picture can be obtained almost without deterioration of the picture quality thereof.
FIG. 5 shows an example of the structure of a filter for reducing/enlarging a picture corresponding to a prior art reference. In FIG. 5, a horizontal interpolating filter 101 is a low-pass filter. The horizontal interpolating filter 101 is composed of one-pixel delaying devices D, coefficient multiplying devices, and an adding device. A vertical filter 102 is low-pass filter. The vertical filter 102 is composed of one-line delaying devices H, coefficient multiplying devices, and an adding device.
When a picture is reduced, picture data received from a terminal 100 is supplied to the horizontal interpolating filter 101 and the vertical interpolating filter 102. The horizontal interpolating filter 101 and the vertical interpolating filter 102 interpolate the picture data in the horizontal direction and the vertical direction, respectively. Pixels of the resultant picture data are thinned out at a predetermined reducing rate and then written to a field memory 103. When the picture size is reduced to 1/2 each in the horizontal direction and the vertical direction, every second pixel in the horizontal direction and every second line in the vertical direction of picture data is written to the field memory 103. The reduced picture data is read from the field memory 103 and supplied to a terminal 104.
When picture data is enlarged, picture data of which dummy data has been placed in the horizontal direction and the vertical direction at predetermined intervals is received from the terminal 100. The resultant picture data is interpolated in the horizontal direction and the vertical direction and written to the field memory 103.
In the picture reducing process for interpolating and thinning out pixels of picture data by such a filter, when the reducing ratio of the size of the original picture to the size of the reduced picture is a ratio of simple integers, pixels of picture data can be easily thinned out. Thus, the picture data can be reduced with a relatively high picture quality. This property also applies to the picture enlarging process. However, in the case that the size of a reduced picture can be freely set up, the reducing ratio does not become a ratio of simple integers. In this case, since it is difficult to equally thin out pixels, the picture quality is deteriorated. For example, inclined lines of a reduced picture are not smoothly displayed. Likewise, in the picture enlarging process, such a situation takes place. In particular, when the ratio of the size of the original picture size to the size of the reduced/enlarged picture is 1/2 to 1 or more than 1, the picture quality is remarkably deteriorated.
As a method for enlarging or reducing a picture at any ratio without a deterioration of the picture quality, for example a linear interpolating method is known. Now, assume that an original picture is sampled as m pixels and n pixels in the horizontal direction and vertical direction, respectively. In addition, consider the case that the picture composed of m.times.n pixels is enlarged to a picture composed of M pixels in the horizontal direction and N pixels in the vertical direction.
According to such a method, a reverse mapping process of which the coordinates of a converted pixel are correlated to the original coordinates thereof. FIG. 6 shows that a pixel a of a converted picture is reversely mapped to the original coordinates thereof. The pixel shown by a black point ".circle-solid." shows a pixel a which is reversely mapped to the original coordinates. The pixel shown by a white point ".smallcircle." shows an original pixel. The density value of a pixel a of the converted picture (hereinafter, "density value of pixel a" is referred to as "density value a") is obtained by multiplying the density values of the pixel a at original four adjacent points thereof by the inverse numbers of the distances between the pixel a. In other words, when the density value of the pixel at each point is represented in the form d(x, y), the density value a is expressed by the following formula (1). EQU a=(1-q)(1-p).times.d(x,y)+(1-q)p.times.d(x+1,y)+q(1-p).times.d(x,y+1)+qp.ti mes.d(x+1,y+1) (1)
With such an interpolating process, when a picture is enlarged or reduced at any ratio rather than a multiple, for example inclined lines can be smoothly displayed with less picture deterioration. With this method, the coefficients p and q should be calculated for each pixel.
FIG. 7 shows the relation between an original picture and a converted picture. In this example, the original picture composed of m.times.n pixels is converted into an enlarged picture composed of M.times.N pixels (m&lt;M, n&lt;N). In this case, the enlarging/reducing ratio A in the horizontal direction and the enlarging/reducing ratio B in the vertical direction are obtained by the following formulas (2) and (3), respectively. EQU A=N/n (2) EQU B=M/m (3)
By dividing the coordinates (X, Y) of a pixel of the converted picture by the converting ratios A and B, the coordinates of which the pixel is reversely mapped to the original coordinates can be obtained. Thus, as described above, the density value of a converted pixel (X, Y) is calculated corresponding to the density values of pixels at original four adjacent pixel positions (x, y), (x+1, y), (x, y+1), and (x +1, y+1) of which the pixel (X, Y) is reversely mapped to the original coordinates and to the distances between four points and the coordinates upon reversely mapping.
When the pixel (X, Y) is reversely mapped to the original coordinates, the position of the original coordinates thereof can be represented corresponding to the converting ratios A and B with the following formulas (4) and (5). EQU x/A=X.sub.1.P.sub.x (4) EQU y/B=Y.sub.1.q.sub.y (5)
In the formulas (4) and (5), X.sub.1 and Y.sub.1 represent coordinates of which a pixel has been converted; p.sub.x and q.sub.y represent interpolating coefficients; and "." between X.sub.1 and p.sub.x and between Y.sub.1 and q.sub.y represents a decimal point. In other words, X.sub.1 and Y.sub.1 are integer parts of the calculated results of x/A and y/B. p.sub.x and q.sub.y that represent interpolating coefficients are decimal parts. Thus, decimal parts of which the position of a converted pixel does not accord with the position of the original pixel are used as interpolating coefficients.
FIG. 8 shows an example of the structure for enlarging/reducing a picture corresponding to such operations and the calculated results by the linear interpolating method. Memories 110a, 110b, 110c, and 110d are random access memories. Original picture data (not shown) is written to the memories 110a, 110b, 110c, and 110d. An address generating circuit 117 supplies an address signal to the memories 110a, 110b, 110c, and 110d. Thus, data of a pixel is read from the memories 110a, 110b, 110c and 110d.
The number of pixels N in the horizontal direction of which a picture has been enlarged or reduced and the number of pixels n in the horizontal direction of an original picture are supplied to terminals 112 and 113, respectively. The number of pixels N and the number of pixels n are supplied to a dividing device 114. The dividing device 114 outputs an enlarging/reducing converting ratio A. At this point, to simplify the processes of downstream stages, n/N is calculated and thereby 1/A is obtained. The inverse number 1/A of the converting ratio is supplied to a high speed multiplying device 115 that performs a multiplying operation corresponding to a count value received from a horizontal coordinate counter 116.
The horizontal coordinate counter 116 successively generates a count value that represents the coordinate x of a pixel in the horizontal direction of the original picture. The count value is supplied to the high speed multiplying device 115. The high speed multiplying device 115 multiplies the coordinate x represented with the count value by the inverse number 1/A of the above-described converting ratio and outputs x/A. As described above, the integer part of the result of x/A is supplied as the converted coordinate X.sub.1 to the address generating circuit 117. The decimal part of the result x/A is supplied as an interpolating coefficient p to multiplying devices 119a and 119b. In addition, the decimal part is supplied to an inverting circuit 118 that outputs the complement of `1` of the received data. Thus, the inverting circuit 118 outputs a value 1-p. The value 1-p is supplied to multiplying devices 119c and 119d.
The vertical direction of the picture is processed in the same manner as the horizontal direction thereof. In other words, the number of pixels m in the vertical direction of the original picture and the number of pixels M in the vertical direction of the converted picture are received from terminals 120 and 121, respectively. The number of pixels m and the number of pixels M are supplied to a dividing device 122. The dividing device 122 calculates m/M and outputs the inverse number 1/B of the converting ratio. The inverse number 1/B is supplied to a multiplying device 123. The multiplying device 123 receives a count value that represents the coordinate y from a vertical coordinate counter 124 that successively generates a count value that represents a pixel y in the vertical direction of the original picture. The multiplying device 123 multiplies the coordinate y represented with the count value by the inverse number 1/B of the above-described converting ratio and outputs y/B. The integer part of the multiplied result is supplied as the converted coordinate Y.sub.1 to the address generating circuit 117 along with the converted coordinate X.sub.1. The decimal part of the multiplied result is supplied as an interpolating coefficient q to the multiplying devices 119a and 119c. In addition, the decimal part is supplied to an inverting circuit 125 that outputs 1-q as the complement of `1` of the received data. The value 1-q is supplied to the multiplying devices 119b and 119d.
The address generating circuit 117 generates addresses for reading pixel data at four points of an original picture used upon obtaining a density value of converted coordinates from the memories 110a, 110b, 110c, and 110d corresponding to the supplied coordinates X.sub.1 and Y.sub.1. In other words, the address generating circuit 117 generates addresses (x.sub.1, y.sub.1), (x.sub.1 +1, y.sub.1), (x.sub.1, y.sub.1 +1) , and (x.sub.1 +1, y.sub.1 +1) for reading pixel data of coordinates (x.sub.1, y.sub.1), (x.sub.1 +1, Y.sub.1), (x.sub.1, y.sub.1 +1), and (x.sub.1 +1, y.sub.1 +1) corresponding to the supplied coordinates X.sub.1 and Y1. The generated addresses are supplied to the memories 110a, 110b, 110c, and 110d.
Corresponding to the supplied addresses, pixel data (density values) of the coordinates (x.sub.1, y.sub.1) , (x.sub.1 +1, y.sub.1) , (x.sub.1, y.sub.1 +1) , and (x.sub.1 +1, y.sub.1 +1) are read from the memories 110a, 110b, 110c, and 110d, respectively. Since the density values at the four points should be read at the same time, the four memories 110a, 110b, 110c, and 110d to which the same original picture data is written are required. The density values d(x.sub.1, y.sub.1), d(x.sub.1 +1, y.sub.1), d(x.sub.1, y.sub.1 +1), and d(x.sub.1 +1, y.sub.1 +1) are supplied to multiplying devices 126a, 126b, 126c, and 126d, respectively.
The multiplying devices 119a , 119b, 119c, and 119d to which interpolating coefficients and complement of `1` thereof are supplied, the multiplying devices 126a, 126b, 126c, and 126d to which density values are supplied, and the adding devices 127a, 127b, and 128 perform the operation expressed by the formula (1) and obtains density values of pixels that have been converted.
However, in the conventional structure shown in FIG. 8, to obtain interpolating coefficients, dividing devices and multiplying devices (including a high speed multiplying device) in the horizontal and vertical directions are required. Since the dividing devices and high speed multiplying device have many gates, they cause the cost of an IC for the apparatus to increase.
In addition, when a plurality of screens that have been converted at any ratio are displayed on the same display, dividing devices and multiplying devices in the horizontal and vertical directions are required for each screen. Thus, to generate coefficients for the linear interpolating process, the circuit scale becomes large, thereby increasing the cost of the apparatus.